Conditions | 1 |
Paths | 1 |
Total Lines | 28 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | var assert = require('assert'); |
||
5 | describe('init the game', function() { |
||
6 | it("should have pieces on the board", function() { |
||
7 | game.init(); |
||
8 | assert.equal(game.p1.color, "white"); |
||
9 | assert.equal(game.p2.color, "black"); |
||
10 | assert.equal(game.p2.color, "black"); |
||
11 | |||
12 | let square = game.board.getSquare("B", 1); |
||
13 | let pawn = game.p1.pawns[0]; |
||
14 | |||
15 | assert.equal(square, pawn); |
||
16 | }); |
||
17 | |||
18 | |||
19 | it("player should have all pieces", function() { |
||
20 | game.init(); |
||
21 | assert.equal(game.p1.pawns.length, 8); |
||
22 | assert.equal(game.p2.bishops.length, 2); |
||
23 | }); |
||
24 | |||
25 | it("return true if open false if closed", function() { |
||
26 | // B2 to F2 open |
||
27 | assert.equal(game.board.checkRow("B", 2, "F", 2), true) |
||
28 | |||
29 | // B2 to B5 Closed |
||
30 | assert.equal(game.board.checkRow("B", 5, "B", 2), false) |
||
31 | }); |
||
32 | }); |
||
33 | }); |
||
34 |